<template>
    <div class="arrang-meeting-dialog">
         <el-dialog
            title="安排评审会议"
            :visible.sync="arrangeMeetingShow"
            width="628px"
            :before-close="handleClose"
            :close-on-click-modal="false"
            custom-class="dialog-box">
            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="118px" class="demo-ruleForm">
                <el-form-item label="评审地点" prop="reviewAddress">
                    <el-input v-model="ruleForm.reviewAddress" maxlength="32"></el-input>
                </el-form-item>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="handleClose">取 消</el-button>
                <el-button type="primary" @click="submitForm">确 定</el-button>
            </span>
        </el-dialog>
    </div>
</template>

<script>
 import { getArrangeMeeting } from "@/api/manage/manage";
    export default {
        name:'ArrangeMeeting',
        props: {
            arrangeMeetingShow: {
                type: Boolean,
                default: ''
            },
            type:{
                type: String,
                default: ''
            },
            proid:{
                type: String,
                default: ''
            }
        },
        inject:['reload'],
        data(){
            return{
                rules:{
                    daterange:[
                        {type:'array' ,required: false,message: "请选择日期", trigger: ["blur", "change"],},
                    ],
                    reviewAddress:[
                        {required: true, message: "请输入地点", trigger: ["blur"],},
                    ],
                },
                ruleForm:{
                  daterange:[],
                  reviewAddress:'',
                  reviewTimeStart: ''
                },
                daterange:[],//时间
            }
        },
        methods:{             /** 取消按钮 */
            handleClose() {
                this.$refs.ruleForm.resetFields();  
                this.isShow=false
                this.radio=''
                this.$emit("changeShowDialog", "false"); //调用父组件的自定义事件，并传值
            },
            /** 确定按钮 */
            submitForm() {
                let data={
                    proId:this.proid,
                    reviewAddress:this.ruleForm.reviewAddress,
                    reviewTimeStart:this.ruleForm.reviewTimeStart,
                    // reviewTimeEnd:this.ruleForm.daterange[1],
                }
                // this.ruleForm.projectId=this.proid
                  this.$refs.ruleForm.validate((valid) => {
                      if(valid){
                          getArrangeMeeting(data).then(res =>{
                              this.$refs.ruleForm.resetFields();
                              this.$emit("changeShowDialog", "false")
                              this.reload()
                                  console.log(res)
                                  this.isShow=false
                                  this.radio=''
                          })
                      }})
            },
            changeTime(){
                
            }
        }
    }
</script>

<style lang="scss" >
</style>